package com.starlink.model.util;

import com.starlink.model.dtomapper.MallIntegrationOrderDtoMapper;
import com.starlink.model.domain.MallIntegrationOrderDO;
import com.starlink.model.vo.MallIntegrationOrderVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallIntegrationOrderConvert {

    public static List<MallIntegrationOrderVO> buildMallIntegrationOrderVoList(List<MallIntegrationOrderDO> mallIntegrationOrderDOList) {
        if (CollectionUtils.isEmpty(mallIntegrationOrderDOList)) {
            return Lists.newArrayList();
        }
        List<MallIntegrationOrderVO> mallIntegrationOrderVOList = new ArrayList<>();
        for (MallIntegrationOrderDO mallIntegrationOrderDO : mallIntegrationOrderDOList) {
            mallIntegrationOrderVOList.add(MallIntegrationOrderDtoMapper.INSTANCE.do2VO(mallIntegrationOrderDO));
        }

        return mallIntegrationOrderVOList;
    }
}
